package com.neusoft.neu24.nep.controller;

import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("nc")
// 热更新
@RefreshScope
public class NacosConfigController {
    @Resource
    private Environment  env;

    @Value("${mysql.name}")
    private String mysqlName;



    @RequestMapping("/e")
    public String getConfig(){
        System.out.println(mysqlName);
        return env.getProperty("spring.application.name")+"-"+env.getProperty("server.port");
    }
}
